﻿using Daemon.Model;
using Microsoft.AspNetCore.Mvc;
using Daemon.Repository.Contract;
using System.Net.Http;
using Microsoft.AspNetCore.Http;
using Daemon.Common;
using System.Net;
using Daemon.Repository.EF.Enums;
using Daemon.Service.Contract;

namespace DaemonAPI
{
	[ApiController]
	[Route("api/[controller]/[action]")]
	public class TakeAwayGoodTypeController : BaseApiController<TakeAwayGoodType, ITakeAwayGoodTypeRepository>
	{
		private readonly ITakeAwayGoodTypeService _takeAwayGoodTypeService;

		public TakeAwayGoodTypeController(ITakeAwayGoodTypeService takeAwayGoodTypeService, ITakeAwayGoodTypeRepository repository, IHttpContextAccessor httpContextAccessor) : base(repository, httpContextAccessor)
		{
			_takeAwayGoodTypeService = takeAwayGoodTypeService;
		}

		[HttpGet, Route("")]
		public ResultModel<TakeAwayGoodType, ITakeAwayGoodTypeRepository> GetAllByShopId(int shopId)
		{
			return new ResultModel<TakeAwayGoodType, ITakeAwayGoodTypeRepository>(HttpStatusCode.OK, _takeAwayGoodTypeService.GetAllByShopId(shopId));
		}
	}
}
